UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U/Rt7+YJre0jk+3zlcoqwpzsFK1fJBdpCc9eZat1jxU='
WHERE
key_id = '0b7d4a5f6f5e18588f21cc9306a11284ead922cd1c5ea7e34281fe40cf713575'
AND (
token = 'U/Rt7+YJre0jk+3zlcoqwpzsFK1fJBdpCc9eZat1jxU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)