UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SQZYo04DBJ47h9LJCoYlfoZkUBVZDcWJNvk/WkRGhtE='
WHERE
key_id = 'f2ab434c9fce742d357a770788679f6546adf5dfede9108bbf8fdc3ee2e0c197'
AND (
token = 'SQZYo04DBJ47h9LJCoYlfoZkUBVZDcWJNvk/WkRGhtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)