UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2iHhn2fId8iagToEKlgj0wOuqqERc+vP6p3aznTmPGg=' 
WHERE 
  key_id = '0552546f2f9da3cd044ef9d92fc5d306b19c57b4b5e62114ce510a62c508e5c1' 
  AND (
    token = '2iHhn2fId8iagToEKlgj0wOuqqERc+vP6p3aznTmPGg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049