UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AUULDnrfLMeABHTyeCsxD7zT+55v5z4vsDGb1ZQoUtY='
WHERE
key_id = 'eb2a10aea075930a2ca5bb05dcb12dc0faa3b7d4105913654c50bc73c751344f'
AND (
token = 'AUULDnrfLMeABHTyeCsxD7zT+55v5z4vsDGb1ZQoUtY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)