UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IFA8LKwn8E/IAaZ5ofvQHnEVD2HJLFBh531NUJDvggA='
WHERE
key_id = '82b4aeb1a14bc38b0eee6bcf04b6a5226d58d722584c0808fda2470cb11f35b0'
AND (
token = 'IFA8LKwn8E/IAaZ5ofvQHnEVD2HJLFBh531NUJDvggA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)