UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M63nCHFXkcMXvGNNWAv3JphiySR/fXV1ja3aI+JFIlo=' 
WHERE 
  key_id = 'f5cc929490169a2225b1c145924f873c58ee111ab2c02191caa7afb32602cd97' 
  AND (
    token = 'M63nCHFXkcMXvGNNWAv3JphiySR/fXV1ja3aI+JFIlo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028