UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kS0/dlx6upBI4zdL3AZDu8PcGc6B6GfQI/Iu4Knjr/U='
WHERE
key_id = '54bc0ffb4be1630f2417bf9b28236371d3f5af0073b3e3b306434a88291a3f4a'
AND (
token = 'kS0/dlx6upBI4zdL3AZDu8PcGc6B6GfQI/Iu4Knjr/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)