UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kPpxvT5Y9Bq3j9IhQLUAD4YQR1ucJaQTRBW98JSO/N0=' 
WHERE 
  key_id = 'f668e72c9bf4fed6cbd613b4cd65dcd66e49e569222d8969524ba07d6592f893' 
  AND (
    token = 'kPpxvT5Y9Bq3j9IhQLUAD4YQR1ucJaQTRBW98JSO/N0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027