UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y4UJqHJntSAzRQBvRKeYlD5SrFxZjOkJvD4cckjKysI='
WHERE
key_id = '53e915cd0b5cc10a36313a292ddfdaf1583ddf1082a2f3c677c72664c16e7a25'
AND (
token = 'Y4UJqHJntSAzRQBvRKeYlD5SrFxZjOkJvD4cckjKysI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)