UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'StHsFHu5juqdPmeL6cR9W0OIM74OdxGV2hMUwdcIXfI='
WHERE
key_id = 'e38f92305bc4beec9c0a1fcafcc8102c93aa579612eab383fbac6f17f08a1ae8'
AND (
token = 'StHsFHu5juqdPmeL6cR9W0OIM74OdxGV2hMUwdcIXfI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)