UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K1qkLyMH8Eaocp37w229lx5Vb/19kIdCkqsl0T5UulY=' 
WHERE 
  key_id = '20f70fb8b880e32a2a00cdcbe64397e62b261c9280870d3d5e3f9495875d2e4a' 
  AND (
    token = 'K1qkLyMH8Eaocp37w229lx5Vb/19kIdCkqsl0T5UulY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00012