UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '16vECVDpKV1V4r7dTHijaMJLrrm9E5LbAQL7xat8JOU='
WHERE
key_id = '9498feed3f864d469d5b5669f0e71bd2ade1a835cea44406fbc7f6edbe9f6c3c'
AND (
token = '16vECVDpKV1V4r7dTHijaMJLrrm9E5LbAQL7xat8JOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)