UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VYRbOPXyOo+kmEeCtMdIqWthZkf/Y9gae+EAnRHR2Vg='
WHERE
key_id = 'ff87608a7972fd2241899c143be920abe91f05432379e28b4d480de58c28a6bf'
AND (
token = 'VYRbOPXyOo+kmEeCtMdIqWthZkf/Y9gae+EAnRHR2Vg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)