UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B7P4KL4UuOohhpJavzJlEo2JxfYTiPpHP8bsmRDpaFc=' 
WHERE 
  key_id = 'cf2c1b02e2a51e9baafc858b5865f997d3da1b0bdb21aa29eed89a4293608b3c' 
  AND (
    token = 'B7P4KL4UuOohhpJavzJlEo2JxfYTiPpHP8bsmRDpaFc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025