UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G4GjIXjcaaS4j7EVWDKz00wfKowMxzoXPO//kvHQuNo=' 
WHERE 
  key_id = '96a8dddf8eb6d5b69ad8069c56a683633e45cf699a8d39724d383e58876bb15a' 
  AND (
    token = 'G4GjIXjcaaS4j7EVWDKz00wfKowMxzoXPO//kvHQuNo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045