UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ArT20QO8Q8AE+y6UNbpgSC1fRQOeTjtARGnhSznePAY=' 
WHERE 
  key_id = 'e46af33f2234de1eee389eb383af322f83cfa4ab2b9bc145cccfb20cea1051a9' 
  AND (
    token = 'ArT20QO8Q8AE+y6UNbpgSC1fRQOeTjtARGnhSznePAY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027