UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KhDBcHD6lnherIwsWvBhvbts3JX7fYDHarXrfSORRYo='
WHERE
key_id = '5ea335a0e5efdf88537c3003305f20c7c34425b5e794ca80bdda10865b12868a'
AND (
token = 'KhDBcHD6lnherIwsWvBhvbts3JX7fYDHarXrfSORRYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)