UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z4VLi8VUJYkl/Q8LPftjnkWBQGf2zD2vEoGkkFkSUOg='
WHERE
key_id = '2bde4931bff23805f635069e98cabf3d355de4e5191b8beb8a19bcf30541cf71'
AND (
token = 'z4VLi8VUJYkl/Q8LPftjnkWBQGf2zD2vEoGkkFkSUOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)