UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7jP18pRJpRcSK1XQRtLdv4B/23vh0jPPiaXk6S9z7hY=' 
WHERE 
  key_id = 'c005e666d4e0325792405f5eb240b06b61d7407d3be24fa34022cdf620bedd1a' 
  AND (
    token = '7jP18pRJpRcSK1XQRtLdv4B/23vh0jPPiaXk6S9z7hY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026