UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ixxPqraFe2slONbjJemKCxwsOG+t8YVJe1oO0C7khfU='
WHERE
key_id = 'd1b3ea27129207049feecae10d98d205810d833576e3f0aaef02d6e79a3eb04d'
AND (
token = 'ixxPqraFe2slONbjJemKCxwsOG+t8YVJe1oO0C7khfU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)