UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Uic6qc0Fg3bx0reOT/kOFw9Sd5s6A/H1jxbC4VtR324=' 
WHERE 
  key_id = '765efbdb6de2e20aa717c240936407979c57b65111ea8d3616897b118f34706c' 
  AND (
    token = 'Uic6qc0Fg3bx0reOT/kOFw9Sd5s6A/H1jxbC4VtR324=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029