UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Rgr9Fcxa+R9zb/e9lvzv5S1eWyCXTydHpmYXkG3rmE=' 
WHERE 
  key_id = '200c686490013fe3d54a682018963752a4531aec7ebcd17e9ef7f837ccee8a62' 
  AND (
    token = '4Rgr9Fcxa+R9zb/e9lvzv5S1eWyCXTydHpmYXkG3rmE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032