UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G3hhJT0WrjXgB0Oqto4W57ZxI6YVgfhO5GF01ZC4W+A=' 
WHERE 
  key_id = '60f080355a4dc002ba33ad0b2c86515f51bb1e1009298e7bdff0c7b58e614b93' 
  AND (
    token = 'G3hhJT0WrjXgB0Oqto4W57ZxI6YVgfhO5GF01ZC4W+A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022