UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MJayeSO7BMf+EG58Hf/EdDuPvxvxNwD9GZbfrDahrh8='
WHERE
key_id = '3a02ffd840bf217d27349b3d3631ba1661dd18f37cef7403a25fc7186c9134a0'
AND (
token = 'MJayeSO7BMf+EG58Hf/EdDuPvxvxNwD9GZbfrDahrh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)