UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mc64Qpzi1Hba/GwNJztQiyhFEwiiM2vQapmugY6J/hU='
WHERE
key_id = '55ceb4b9637a3c0ba7ea4f6f1b214b481619d096c759efe93e4322c14539f302'
AND (
token = 'Mc64Qpzi1Hba/GwNJztQiyhFEwiiM2vQapmugY6J/hU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)