UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wd8rEehM7V/aab6eEbNHMPcUAETcwJpQcHd1ORM4ULA='
WHERE
key_id = 'fff3b5687b6de20d54642965a9192c081155e29a83b6c6c3acbffe1dd6819a40'
AND (
token = 'wd8rEehM7V/aab6eEbNHMPcUAETcwJpQcHd1ORM4ULA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)