UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vvuLL6CXM7u6CCvfOGz47DBareOTyv5Geq+tUXGY7Ew=' 
WHERE 
  key_id = '38fca5a7d93d0791899c3d5273f26578a2e8a2b022f1a52248d8e8ec250809b1' 
  AND (
    token = 'vvuLL6CXM7u6CCvfOGz47DBareOTyv5Geq+tUXGY7Ew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022