UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W6p/FkaLNopUKihrIP3EK32h498PsCokKjz6Dqh7tWo=' 
WHERE 
  key_id = 'e951b224acc348df95c55cf085d94399dd20f025330f401ae0e80ffddcf88223' 
  AND (
    token = 'W6p/FkaLNopUKihrIP3EK32h498PsCokKjz6Dqh7tWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060