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