UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KeFoyWNl8OynHZghymj9ZJ3icZ6J2nJr87x61ugvF2I='
WHERE
key_id = '0ba1e813668dcf696e5b4b0d0cd2df71bc63f16d1a4a46fcd47625943ec7b052'
AND (
token = 'KeFoyWNl8OynHZghymj9ZJ3icZ6J2nJr87x61ugvF2I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)