UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M8OHkJwqnCG6j3QU0j1lpETtIcTyp/iNzK/ufZpUdEY=' 
WHERE 
  key_id = '44af9b36bb93c1bc55eb857fd22dbd9a287b5546827d0d610ca440e3d22f7c74' 
  AND (
    token = 'M8OHkJwqnCG6j3QU0j1lpETtIcTyp/iNzK/ufZpUdEY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054