UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BlC6Mb1lq8MdOTwl3TBAb5W4UifSt41XW7j3wxG04tI='
WHERE
key_id = '06bf5046347e0b99494489d43c36cdb3667cca181fb99215a162e7b2d2272b19'
AND (
token = 'BlC6Mb1lq8MdOTwl3TBAb5W4UifSt41XW7j3wxG04tI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)