UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0ZoL6K15hGP9E5ffM7A5Ti7sxBf9MvtvsbvLWOpqHa0='
WHERE
key_id = '8ce230f3bd99c7fdfb57cdf8cf1ce12a31cb99537a45250793a30a66f4f5003b'
AND (
token = '0ZoL6K15hGP9E5ffM7A5Ti7sxBf9MvtvsbvLWOpqHa0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)