UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2xB6rjIMjxALEBbiyVR42GQ6o1C1YYDF4OQrS9kVXNw='
WHERE
key_id = '276584a0ed4a4bd11c1be65a8d4072721988d907c900e997b3b138faeb5f1cb2'
AND (
token = '2xB6rjIMjxALEBbiyVR42GQ6o1C1YYDF4OQrS9kVXNw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)